<extend name="Public:common" />
<!--/sidebar-->
<block name="content">
		<div class="main-wrap">

			<div class="crumb-wrap">
				<div class="crumb-list">
					<i class="icon-font"></i>
					<a href="__MODULE__/Index/index">首页</a>
					<span class="crumb-step">&gt;</span>
					<span class="crumb-name">管理员列表</span>
				</div>
			</div>
			<div class="result-wrap">
				<form name="myform" id="myform" method="post">
					<div class="result-title">
						<div class="result-list">
							<a href="__MODULE__/Rbac/insert">
								<i class="icon-font"></i>
								添加帐号
							</a>
							<a id="batchDel" href="javascript:delall(<{$p}>)">
								<i class="icon-font"></i>
								批量删除
							</a>
							<a id="updateOrd" href="javascript:sort()">
								<i class="icon-font"></i>
								更新排序
							</a>
						</div>
					</div>
					<div class="result-content">
						<table class="result-tab" width="1125">
							<tr id='tr'>
								<th class="tc" width="30">
									<input  type="checkbox" class='chkall'  />
								</th>
								<th>排序</th>
								<th>ID</th>
								<th>用户帐号</th>
								<th>中文名</th>
								<th>角色</th>
								<th>登录时间</th>
								<th>登录ip</th>
								<th>操作</th>
							</tr>
							<volist name='ulist' id='vo' empty='暂无数据'>
							<tr>
								<td class="tc">
									<input  value="<{$vo.id}>" type="checkbox" name='id' class='chk'>
								</td>
								<td>
									<input class="common-input sort-input sort" name="sort[]"  value="<{$vo.sort}>" type="text">
									<input type='hidden' name='id[]' value='<{$vo.id}>' />
								</td>
								<td><{$vo.id}></td>
								<td>
									<{$vo.account}>
								</td>
								<td>
									<{$vo.nickname}>
								</td>
								<td>
									<{$vo.jiaose}>
								</td>
								<td>
									<{$vo.createtime|date='Y-m-d H:i:s',###}>
								</td>
								<td>
									<{$vo.ip}>
								</td>
								<td>
									<a class="link-update" href="__MODULE__/Rbac/rbedit/id/<{$vo.id}>">编辑</a>
									<a class="link-del" href="javascript:del(<{$vo.id}>);">删除</a>
								</td>
							</tr>
							</volist>
							<tr>
							<td colspan='10'>
								<div class="pages"  ><{$page}></div>
							</td>
							</tr>
						</table>
						
					</div>
				</form>
			</div>
		</div>
		<!--/main-->
	<script>
		//全选
		$('.chkall').click(function(){
			
			$(".chk").prop('checked',this.checked)
			
		})
		//排序方法
		function sort(){
			var json = $("#myform").serializeArray();
			$.post("__MODULE__/Rbac/sort",json,function(d){
				location.reload;
			});
						
		}
		//单个删除
		function del(n){
			//删除 商品 漂亮的提示信息
			$.MsgBox.Confirm("删除提示", "您确认删除该帐号", function () { 
				//发送 当前商品的id 和当前用户帐号
				$.post("__MODULE__/Rbac/del",{"id":n},function(d){
					if(d.status == 1){
						var mg = "成功信息";
					}else{
						var mg = "失败信息";
					}
					
					$.MsgBox.Alert(mg, d.message);//删除后刷新本页
					location.reload();
				},"json");
			})
		}
		//多个删除
		function delall(){
			//删除 商品 漂亮的提示信息
			$.MsgBox.Confirm("删除提示", "您确认删除该帐号", function () { 
				var str = "";
				$(".chk:checked").each(function(i,e){
					str += $(e).val()+",";
				})
				if(str == ""){
					$.MsgBox.Alert("提示","未选择");
					return;
				}
				//发送 当前商品的id 和当前用户帐号
				$.post("__MODULE__/Rbac/del",{"id":str},function(d){
					if(d.status == 1){
						var mg = "成功信息";
					}else{
						var mg = "失败信息";
					}
					$.MsgBox.Alert(mg, d.message);//删除后刷新本页
					//location.href='__CONTROLLER__/usercart';
					location.reload();
				},"json");
				
			})
		}
	
	</script>
	</block>